<?php 

class ComHeader
{
	public $Id;
	public $ImageL;
	public $ImageR;
	public $Image;
	public $Image2;
	public $Height;
	public $Button;
	public $Icon;
	public $Imagefont;
	
	public function ComHeader($id) 
	{ 
		if($id > 0)
		{ $this->Id = $id; }
	}
	
	public function getId() { return $this->Id; }
	public function getImageL() { return $this->ImageL; }
	public function getImageR() { return $this->ImageR; }
	public function getImage() { return $this->Image; }
	public function getImage2() { return $this->Image2; }
	public function getHeight() { return $this->Height; }
	public function getButton() { return $this->Button; }
	public function getIcon() { return $this->Icon; }
	public function getImagefont() { return $this->Imagefont; }
	
	public function setId($val) { $this->Id=$val; }
	public function setImageL($val) { $this->ImageL=$val; }
	public function setImageR($val) { $this->ImageR=$val; }
	public function setImage($val) { $this->Image=$val; }
	public function setImage2($val) { $this->Image2=$val; }
	public function setHeight($val) { $this->Height=$val; }
	public function setButton($val) { $this->Button=$val; }
	public function setIcon($val) { $this->Icon=$val; }
	public function setImagefont($val) { $this->Imagefont=$val; }
	
	public function getHTML($buttons, $text, $text2='', $text3='', $icon='')
	{
		if($this->Id > 0)
		{
			$out = '<div class="com_header">';
				$out .= '<div class="ch_'.$this->Id.'">';
					if($this->ImageL != '')
					{ $out .= '<div class="ch_left">'; }
						if($this->ImageR != '')
						{ $out .= '<div class="ch_right">'; }
							$out .= '<div class="ch_center">';
								$out .= '<div class="ch_content">';
									if($this->Icon > 0)
									{ 
										$iconset = getIconSet($header['icon']); 
										if($iconset)
										{
											$out .= '<span class="ch_icon"><img src="images/system/icon_spacer.gif"';
											$out .= ' alt="" style="width:'.$iconset['width'].'px; height:'.$iconset['height'].'px;" /></span>';
										}
									}
									
									if($this->Imagefont > 0)
									{ 
										$out .= '<h2 class="ch_txt">';
										$out .= getImageFont($text, $text2, '', '', 0, 0); 
										$out .= '</h2>';
									}
									else
									{ 
										$out .= '<h2 class="ch_txt">';
										$out .= $text; 
										$out .= '</h2>';
										if($text2 != '')
										{ $out .= '<h2 class="ch_txt2">&nbsp;'.$text2.'</h2>'; }
										if($text3 != '')
										{ $out .= '<h2 class="ch_txt3">&nbsp;'.$text3.'</h2>'; }
									}
									if($buttons)
									{ $out .= '<span class="ch_buttons">'.getButtonsHTML($this->Button, $buttons).'</span>'; }
								$out .= '</div>';
							$out .= '</div>';
						if($this->ImageR != '')
						{ $out .= '</div>'; }
					if($this->ImageL != '')
					{ $out .= '</div>'; }
				$out .= '</div>';
			$out .= '</div>';
			return $out;
		}
	}
}
 
?>